7.4 Replication Notes
There are three stages of statistical analysis in this article. The first is to replicate
the three political studies and demonstrate their out-of-bounds violations. The second includes three simulation
tests to compare TRM and TRMCO. The third is to apply the TRMCO model to the Hellwig and Samuels's regression
analysis.
Download all replication files
Stage 1 Analysis: Three Political Studies
The first part in replicating three political studies is executed in the Stata environment.
Save all the data files under your designated directory. The default is set "C:\".
Hellwig and Samuels 2007
OLS's out-of-bounds violation for Model I:
- use "C:\HellwigSamuelsCPS2007.dta", clear
- regress incvotet incvotet1 dgdp tradeshr gdpxtradeshr electype gdpxelect presrun enlp income regafrica
regasia regcee reglatam, cluster(code)
- predict yhat1
- sum yhat1
TRM's out-of-bounds violation for Model I:
- truncreg incvotet incvotet1 dgdp tradeshr gdpxtradeshr electype gdpxelect presrun enlp income regafrica
regasia regcee reglatam, cluster(code) ll(0) ul(100)
- predict yhat2
- sum yhat2
OLS's out-of-bounds violation for Model II:
- regress incvotet incvotet1 dgdp grosscap gdpxgrosscap electype gdpxelect presrun enlp income regafrica
regasia regcee reglatam, cluster(code)
- predict yhat3
- sum yhat3
TRM's out-of-bounds violation for Model II:
- truncreg incvotet incvotet1 dgdp grosscap gdpxgrosscap electype gdpxelect presrun enlp income regafrica
regasia regcee reglatam, cluster(code) ll(0) ul(100)
- predict yhat4
- sum yhat4
Hansford and Gomez 2010
OLS's out-of-bounds violation in the F-test for excluded instruments:
- set mem 500m
- use "C:\HansfordGomez_Data.dta", clear
- xtreg GOPIT DemVoteShare2_3MA Yr52 Yr56 Yr60 Yr64 Yr68 Yr72 Yr76 Yr80 Yr84 Yr88 Yr96 Yr92 Yr2000
DNormPrcp_KRIG RainGOPI Rain_DVS23MA, fe robust
- predict yhat5
- sum yhat5
TRM's out-of-bounds violation in the F-Tests for excluded instruments:
- use "C:\HansfordGomez_MeanbyGroup.dta", clear
- truncreg gopit demvoteshare2_3ma yr52 yr56 yr60 yr64 yr68 yr72 yr76 yr80 yr84 yr88 yr96 yr92 yr2000
dnormprcp_krig raingopi rain_dvs23ma, robust ll(-100) ul(100)
- predict yhat6
- gen origin_gopit=yhat6+mean_gopit
- sum origin_gopit
Acemoglu et al. 2008
Before we start replications, run the following commands:
- set mem 500m
- use "C:\income_demo_5years.dta", clear
- tsset code_numeric year_numeric
- sort code_numeric year_numeric
- tab year, gen (yr)
- tab code, gen(cd)
- set matsize 800
OLS's out-of-bounds violation for the pooled model:
- reg fhpolrigaug L.(fhpolrigaug lrgdpch) yr* if sample==1, cluster(code)
- predict yhat7
- sum yhat7
TRM's out-of-bounds violation for the pooled model:
- truncreg fhpolrigaug L.(fhpolrigaug lrgdpch) yr* if sample==1, cluster(code) ll(0) ul(1)
- predict yhat8
- sum yhat8
OLS's out-of-bounds violation for the fixed-effect model:
- reg fhpolrigaug L.(fhpolrigaug lrgdpch) yr* cd* if sample==1, cluster(code)
- predict yhat9
- sum yhat9
TRM's out-of-bounds violation for the fixed-effect model:
- truncreg fhpolrigaug L.(fhpolrigaug lrgdpch) yr* cd* if sample==1, cluster(code) ll(0) ul(1)
- predict yhat10
- sum yhat10
Stage 2 Analysis: Simulation Tests
All three simulations are executed in the Stata environment for OLS and TRM, and in the
Matlab environment for TRMCO. All the files are saved in the directory labeled "OLS_simulation1",
"TRM_simulation1", "TRMCO_simulation1", $\cdots$. The simulation datasets are
"trialdata1.mat", "trialdata2.mat", and "trialdata3.mat" generated by
"samlping1.m", "sampling2.m", and "sampling3.m" in Matlab. For OLS and TRM,
we separate the dataset into $10$ subsamples for each simulation test, and it is labeled as
"sample1.dta", "sample2.dta",$\cdots$,"sample30.dta" for the three tests.
Simulation Tests for OLS
- do "C:\OLS_simulation1\olsreg1.do"
- do "C:\OLS_simulation2\olsreg2.do"
- do "C:\OLS_simulation3\olsreg3.do"
Simulation Tests for TRM
- do "C:\TRM_simulation1\truncreg1.do"
- do "C:\TRM_simulation2\truncreg2.do"
- do "C:\TRM_simulation3\truncreg3.do"
Note that the result files are "ols_result1.dta,"
"truncreg_result1.dta,"$\cdots$. The coefficient $b_{3}$ is the constant.
Simulation Tests for TRMCO and Table 1
- format shortG
- enter "C:\TRMCO_simulation1\" under the Matlab environment and run "experiment1.m"
- run "getresult1.m"
- display(getstats)
- enter "C:\TRMCO_simulation2\" under the Matlab environment and run "experiment2.m"
- run "getresult2.m"
- display(getstats)
- enter "C:\TRMCO_simulation3\" under the Matlab environment and run "experiment3.m"
- run "getresult3.m"
- display(getstats)
Simulation Tests for Table 2
- format shortG
- enter "C:\TRMCO_simulation1\" under the Matlab environment and run "adt1.m"
- display(adcoeff1)
- enter "C:\TRMCO_simulation2\" under the Matlab environment and run "adt2.m"
- display(adcoeff2)
- enter "C:\TRMCO_simulation3\" under the Matlab environment and run "adt3.m"
- display(adcoeff3)
Stage 3: Replication of Hellwig and Samuels (2007)
We replicate Hellwig and Samuels's (2007) Model I and Model II (p.292). Given that the original
model is not strictly linear, the replication result will be slightly different due to the different centering method.
OLS and TRM are implemented in the Stata environment, whereas TRMCO is executed in the Matlab environment.
Replication of Hellwig and Samuels's Model I, Table 3
- use "C:\fixmin_Hellwig1.dta", clear
- regress incvotet incvotet1 dgdp tradeshr gdpxtradeshr electype gdpxelect presrun enlp income regafrica
regasia regcee reglatam, cluster(code)
- truncreg incvotet incvotet1 dgdp tradeshr gdpxtradeshr electype gdpxelect presrun enlp income regafrica
regasia regcee reglatam, cluster(code) ll(0) ul(100)
- enter "C:\TRMCO_replication1\" under the Matlab environment and run "model1.m"
Replication of Hellwig and Samuels's Model II, Table 4
- use "C:\fixmin_Hellwig2.dta", clear
- regress incvotet incvotet1 dgdp grosscap gdpxgrosscap electype gdpxelect presrun enlp income regafrica
regasia regcee reglatam, cluster(code)
- truncreg incvotet incvotet1 dgdp grosscap gdpxgrosscap electype gdpxelect presrun enlp income regafrica
regasia regcee reglatam, cluster(code) ll(0) ul(100)
- enter "C:\TRMCO_replication2\" under the Matlab environment and run "model2.m"
Translation of Boundary Violations, Table 5
- enter "C:\TRMCO_replication1\" under the Matlab environment.
- run "load stataresult1.mat"
- run "identify([trmb;trmsig])"
- run "load overall_result1.mat"
- run "load identify(trmcom(1:1:m+2)$^{\prime}$)"
- enter "C:\TRMCO_replication2\" under the Matlab environment.>
- run "load stataresult2.mat"
- run "identify([trmb;trmsig])"
- run "load overall_result2.mat"
- run "load identify(trmcom(1:1:m+2)$^{\prime}$)"
Download all replication files